Skip to content

fix(share): exclude private paths from portable project files - #8804

Merged
terencecho merged 6 commits into
mainfrom
codex/portable-source-path-policy
Nov 25, 2026
Merged

terencecho merged 6 commits into
mainfrom
codex/portable-source-path-policy

Conversation

@terencecho

@terencecho terencecho commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Apply the shared private-path rules to editable project capture and manifest validation. Credential files and tool state stay local, including inside nested folders. Existing stored manifests retain their original digests. Authored paths such as a font in a hidden folder and differently cased ignore files keep their existing capture behavior.

Verification

All 170 share tests passed locally. A capture fixture checks a font, mixed-case project metadata, private stores and a Keynote deck together. The manifest vectors check that readers retain historical digests while enforcing the current private-path rules on uploads.

fails without the fix: three fixtures fail on the previous implementation, including validation of private paths against the portable contract.

@mintlify

mintlify Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
hyperframes 🟢 Ready View Preview Nov 25, 2026, 4:30 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST_CHANGES

Reviewed at 612b8f02d1b69b1a4ade660d5b59dbda592aa2fd. The parser refactor and the stored-manifest handling are sound. Two cases now produce wrong results for projects that shared correctly on v11. I reproduced both against the merge-base (59bac900).

Blocking

1. Page-loaded assets in hidden folders are dropped from editable source, but Studio still serves them
packages/share/src/sources/contract/path-policy.json:427 (unrecognized-hidden) excludes every hidden path that portable-hidden-sources (line 420) does not name. isStudioPrivatePath deliberately keeps one exception: a file in a hidden folder is served when its name is a page-loaded type (packages/parsers/src/privatePath.ts:104, LOADED_ASSET_TYPE at :131). packages/core/src/safePath.test.ts:411-412 pins that .config/fonts/brand.woff2 and .assets/animation.js are served. The preview and the rendered video therefore use these files, but the shared source now leaves them out. Nothing warns about it, so whoever opens the editable source gets a composition that renders differently.

Repro: a project containing index.html (which loads .fonts/Inter.woff2 and .styles/main.css), plus those two files, run through captureProject:

  • base: [".fonts/Inter.woff2", ".styles/main.css", "index.html", ...]
  • head: ["index.html", ...]: both assets are excluded by unrecognized-hidden

validatePath agrees: .config/fonts/brand.woff2, .assets/animation.js and .fonts/Inter.woff2 are allowed at base and rejected (unrecognized-hidden) at head. sub/.media/audio/bgm.wav is also rejected, and Studio serves that too (safePath.test.ts, same block).

Suggested fix: add an include rule ahead of unrecognized-hidden that mirrors the Studio exception. A file inside a hidden folder (other than the private and tool folders, which earlier rules already exclude), whose own name is not hidden and has a page-loaded extension, should travel. Add a capture test with a font or stylesheet under a hidden folder.

2. A differently-cased name that matches an include rule now fails the whole source capture
The include rules are matched on the folded spelling, so the literal-spelling check in validatePath (packages/share/src/sources/pathPolicy.mjs:184) throws reserved_path_alias. Capture reports that path as invalid-name (capture.mjs:60), and that refuses the entire source, not just the one file.

Repro (index.html plus one extra file):

  • .Gitignore: base captures it; head returns problems [{ path: ".Gitignore", problem: "invalid-name", code: "reserved_path_alias" }]
  • .GITIGNORE and .GitHub/workflows/ci.yml: same result

On v11 these were ordinary authored files. On v12 they block source sharing for the whole project. Either exclude them (fall through to unrecognized-hidden) or accept them in any case. Whichever you choose, add a capture test for it.

Non-blocking

  • excludedFolder skips unrecognized-hidden (pathPolicy.mjs:244), so capture still walks every hidden folder (.venv, .yarn/cache, .pnpm-store, ...) and classifies each file just to drop it. This isn't a regression, because base walked them too and included them. But you could now prune any hidden folder that cannot hold an allowed descendant (anything other than .media, .github and .hyperframes).
  • The descriptions of two valid vectors are now stale. portable-hidden-and-media (manifest-vectors.json:223) still says "and hidden authored files", and agent-config-look-alikes-that-travel still says "a dotfile that only starts like one", but the PR removed those files (deck.key became deck.pdf, .gemini-notes.md became Gemini-notes.md).
  • matches() special-cases two rule ids by name (pathPolicy.mjs:116). That works, but a flag on the rule in the contract would keep the client and the server spec in one place.

Verified

  • Parser refactor is equivalent. I ran a differential of base vs head for the three parser path predicates (including isStudioPrivatePath) over 900k random paths. The paths mixed separators, case, full-width letters, invisible characters, :stream, trailing dots and spaces, .., and empty segments. There were 0 differences, except names that contain a newline, where head is stricter. Core safePath.test.ts: 206 passed.
  • Contract and parser agree. The new test pins private-source to portablePrivatePattern. Spot checks (assets/DECK.KEY, full-width service-account.json, .ENV, a zero-width character before .env) are all kept out by both.
  • Older manifests still load. Every v11 valid vector, read at head through parseStoredManifest and localBaseDigest, keeps its original digest. That includes the old deck.key and .gemini-notes.md versions. A v11-style manifest listing .prettierrc, .fonts/Inter.woff2, assets/deck.key and .kube/config also loads in stored mode. An unconfirmed saved upload holding such paths is cleared by recoverSourceUpload (canUploadStoredPath is false), so nothing crashes or gets re-sent.
  • Tests. All 170 share tests pass at head. Red-first: running the head tests against base src fails 3 of them: "editable source omits credential stores and unrecognized hidden files…", "every invalid vector is refused with the server's code and rule", and "the portable contract tracks the complete parser private-path expression".

Need · Size · Reuse · Simpler · Structure: the need is real (private names were omitted on the client but accepted on the server). Size is +607/-73, mostly fixtures, with about 150 lines of code. Reuse is good: the contract regex is derived from the parser's lists and pinned by a test. Simpler: fine apart from the id-keyed matches(). Structure: fine.

Risk: medium. The new catch-all for hidden paths is broader than Studio's own rule, so it silently drops assets compositions load (1) and refuses whole projects over a cased dotfile (2). A server on v12 will also reject uploads from v11 clients that list hidden authored files, so plan the rollout order.

'fails without the fix:' check: the PR body has no fails without the fix: line. Independently, 3 of the new tests fail at the merge-base (listed above).

— Rames

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 273 (base branch 271), smooth 55 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Newly passing (2)

  • seqscaletwice-scale-px-r0-nested-z100
  • seqscaletwice-scale-px-r0-root-z100

Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)

  • seqscaletwice-scale-px-r0-nested-z100
  • seqscaletwice-scale-px-r0-root-z100

Quarantined, measured but not gated (0)

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE at 8e2e520f831d781c02c578276a18166d9164a383.

Since my approval at 863f2a69 the only change is a merge from the branch's base, plus the regenerated skills manifest. The PR's diff against its merge base is line-for-line the same as at 863f2a69 (12 files), except one manifest hash pair. That pair is the regenerated value for the merged-in skill content, not a change to this PR's logic. The review at 863f2a69 stands.

Need · Size · Reuse · Simpler · Structure: unchanged from the prior review · merge-only delta · n/a · n/a · ok
Risk: low. The merge was clean, and the only PR-side change is a regenerated manifest hash.

— Rames

@terencecho
terencecho added this pull request to the merge queue Nov 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 25, 2026
@terencecho
terencecho enabled auto-merge November 25, 2026 05:38

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE at 29495ae42e724f78d1b86b17de734cb69c3b643e.

The only commit since my approval at 8e2e520f is a merge of main plus a regenerated skills-manifest.json. Outside that manifest, the PR's diff against its merge base matches the diff at 8e2e520f line for line (12 files). In the manifest, only the media-use hash changed. It is the regenerated value for the media-use skill content that came in from main. gen-skills-manifest.ts --check passes locally at this head, and CI's "Skills: manifest in sync" check also passes. The review at 8e2e520f stands.

Need · Size · Reuse · Simpler · Structure: unchanged from the prior review · merge-only change · n/a · n/a · ok
Risk: low. The only change on the PR side is a regenerated manifest hash.

— Rames

@terencecho
terencecho added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 44d49a5 Nov 25, 2026
90 checks passed
@terencecho
terencecho deleted the codex/portable-source-path-policy branch November 25, 2026 06:21
@miguel-heygen miguel-heygen mentioned this pull request Nov 25, 2026
3 of 4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants